package com.qf.fronted.service;

import com.qf.commons.Data;
import com.qf.fronted.domain.Order;
import com.qf.fronted.domain.WebOrder;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface OrderService {

    Data ensureOrder(Map<Integer, Integer> goodsInf, Integer defaultTakeDelivertyAddressId, Integer userId);

    /**
     * 用户确认支付
     * @param orderNo
     * @param userId
     * @return
     */
    Data confirmPay(String orderNo, Integer userId);

    /**
     *
     * @param status
     * @param userId
     * @return
     */
    List<WebOrder> getOrdersByStatus(Integer status, Integer userId);

    //获取订单信息,用于展示到支付页面
    List<Order> getOrderInfo(String orderNo);

    //创建订单
    void updateStateAndSavePayInfo(String orderNo, Integer newStatus,String tradeNo,String trade_status);

    void deleteOrder(String orderNo) throws SQLException;

    void cancelOrder(String orderNo) throws SQLException;
}
